package org.biubiu0002.baiblog.im.constants;

/**
 * @Author: biubiu0002
 * @Date: 2022/9/2 9:59
 **/
public class RedisConstants {


    /**
     * 登录token
     */
    public static String getTokenKey(String token) {
        return String.format("BAIBLOG:TOKEN:%s", token);
    }

    /**
     * 离线消息存储key
     * @param uid 接受用户id
     * @return key
     */
    public static String getOffRxKey(String uid){
        return String.format("BAIBLOG:IM:OFFRX:%s",uid);
    }

    /**
     * 用户最后一条消息key
     * map<sessionId,latestMsg>
     * @param uid uid
     * @return key
     */
    public static String getLatestConversationKey(String uid){
        return String.format("BAIBLOG:IM:LATESTCONVERSATION:%s",uid);
    }

    /**
     * 用户未读数量key
     * map<sessionId,int>
     * @param uid
     * @return
     */
    public static String getUnreadKey(String uid) {
        return String.format("BAIBLOG:IM:UNREAD:%s",uid);
    }
}
